package leetcode.easy.limit50;

import java.util.Objects;

/**
 * @author liuyy
 * @className No9
 * @description 回文数
 * @date 2019/10/30 12:15
 **/
public class No9 {
    public static void main(String[] args) {
        No9 no9 = new No9();
        boolean palindrome = no9.isPalindrome(110011);
        System.out.println(palindrome);
    }

    public boolean isPalindrome(int x) {
        String numStr = x + "";
        int left = 0;
        int right = numStr.length() - 1;
        while (left < right) {
            if (numStr.charAt(left) != numStr.charAt(right)) {
                return false;
            }
            left++;
            right--;
        }
        return true;
    }
}
